const app = getApp()

Page({
  data: {
    notice:true,
    list: []
  },
  onLoad: function (t) {
    getApp().page.onLoad(this, t),
    this.setData({
      is_focus: t.is_focus == 1 ? 1 : 2
    }), this.loadData(t);
    wx.setNavigationBarTitle({
      title: "官方消息"
    })
  },
  loadData(t){
    var a = this;
    getApp().core.showLoading({
        title: "加载中"
    }), getApp().request({
        url: getApp().api.weitao.get_not_focus,
        data: {
          is_focus: 0
        },
        success: function(t) {
            0 == t.code && a.setData({
                list: t.data.list,
            });
        },
        complete: function() {
            getApp().core.hideLoading();
        }
    });
  },
  onUnload(){ 
    const eventChannel = this.getOpenerEventChannel()
    eventChannel.emit('someEvent', 1);
  },
  //跳转页面
  goUrl: function (e) {
    var gopage = e.currentTarget.dataset.url;
    if (!gopage) {
      return;
    }
    getApp().core.navigateTo({
      url: gopage
    });
  },
})
